function pluck<T, K extends keyof T>(obj: T, names: K[]): T[K][] {
  return names.map(name => obj[name]);
}
interface Person3 {
  name: string;
  age: number;
}
const person3: Person3 = { name: 'Jarid', age: 35 };
const res2 = pluck(person3, ['name']);
console.log(res2); // ["Jarid"]

// T--->person3
// K--->['name', 'age']
// T[K][]--->['Jarid']
